<?php

class EmailLogRoute extends CEmailLogRoute
{
	
	protected function sendEmail($email,$subject,$message)
	{
		
		if(Yii::app()->errorHandler->error['code'] == 404)
			return; 
		
		$request = Yii::app()->request;
		$pre 			 = "URL - " . Yii::app()->createAbsoluteUrl($request->getRequestUri()) . "\r\n";
		$pre  			.= "IP - " . $request->userHostAddress . "\r\n";
		$pre  			.= "REFERER - " . $request->getUrlReferrer() . "\r\n";
		
		$message =  $pre . $message;		
		$mail = array (
			'from' 		=> Yii::app ()->params ['noreplyEmail'], 
			'to'	 	=> $email, 
			'subject' 	=> $subject, 
			'body' 		=> $message 
		);
		$sent = YumMailer::send ( $mail );
		
	}
}